<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增基础抽取')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-etl-add">
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">编码：</label>
                        <div class="col-sm-8">
                            <input name="cd" class="form-control" type="text">
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">名称：</label>
                        <div class="col-sm-8">
                            <input name="na" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">抽取分类：</label>
                        <div class="col-sm-8">
                            <select name="sdDrawcls" class="form-control m-b" th:with="type=${@baseSd.getItem('draw_cls')}">
                                <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.cd}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">启用标志：</label>
                        <div class="col-sm-8">
                            <select name="fgAct" class="form-control m-b">
                                <option value=1>启用</option>
                                <option value=0>停用</option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">系统：</label>
                        <div class="col-sm-8">
                            <select name="sdSys" class="form-control m-b" th:with="type=${@baseSd.getItem('hos_sys')}">
                                <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.cd}"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">数据源：</label>
                        <div class="col-sm-8">
                            <select name="idDb" class="form-control m-b" th:with="type=${@baseDbService.selectAll()}">
                                <option th:each="item : ${type}" th:text="${item.na}" th:value="${item.idDb}"></option>
                            </select>
                        </div>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-sm-6">
                    <div class="form-group">
                        <label class="col-sm-3 control-label">目标表：</label>
                        <div class="col-sm-8">
                            <input name="cdTbTar" class="form-control" type="text">
                        </div>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">前置SQL：</label>
                <div class="col-sm-9">
                    <textarea name="sqlBefore" class="form-control" rows="2"></textarea>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-2 control-label">查询SQL：</label>
                <div class="col-sm-9">
                    <textarea name="sqlQry" class="form-control" rows="10"></textarea>
                </div>
            </div>
        </form>
        <p style="color: indianred">变量说明：开始时间${DT_DAY_BEGIN},结束时间${DT_DAY_END}。yyyyMMdd格式${D_BEGIN},${D_END}</p>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "etl/base"
        $("#form-etl-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-etl-add').serialize());
            }
        }
    </script>
</body>
</html>